/**
 * 工具函数
 */
const utils = {}
/*
@createToast 封装组件
*/
utils.createToast = function(status,msg){
    let toast = document.createElement('div')
    toast.className = 'toast'
    let html = `
    <p>
    <span class='icon'>${status===0?'√':'x'}</span>
    </p>
    <p>${msg}</p>
    `
    toast.innerHTML = html
    let bodyDom = document.querySelector('body')
    bodyDom.appendChild(toast)
    setTimeout(function(){
        toast.remove()
    },1000)
}
window.utils = utils